Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

C++17: std::char_traits<>::{compare,length} is constexpr - v2 #2257

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

phprus
Copy link
Contributor

@phprus phprus commented Apr 27, 2021

@vitaut vitaut merged commit 0cd0fb9 into fmtlib:master Apr 28, 2021
@vitaut
Copy link
Contributor

vitaut commented Apr 28, 2021

Thank you!

@vitaut
Copy link
Contributor

vitaut commented Apr 28, 2021

BTW Jonathan Wakely suggested using __cpp_lib_constexpr_char_traits to detect this in libstdc++: https://twitter.com/wakomeup/status/1387422935590260738.

@phprus
Copy link
Contributor Author

phprus commented Apr 28, 2021

https://github.com/gcc-mirror/gcc/blob/releases/gcc-7.1.0/libstdc++-v3/include/bits/char_traits.h:

// #define __cpp_lib_constexpr_char_traits 201611

Macro __cpp_lib_constexpr_char_traits defined only in gcc-8 and newer, but constexpr char_traits is presented in gcc-7.

Tweet not found ("Hmm...this page doesn’t exist. Try searching for something else.") :(

@vitaut
Copy link
Contributor

vitaut commented Apr 28, 2021

On further investigation it turned out that __cpp_lib_constexpr_char_traits is not defined consistently.

@vitaut
Copy link
Contributor

vitaut commented Apr 28, 2021

Tweet not found ("Hmm...this page doesn’t exist

It was retracted =)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants